﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Adminitrator.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="admin_Contacts_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
   <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>    
  <h1 class="title">
    Danh sách liên hệ</h1>
  <div class="search">
    <fieldset class="fieldset">
      <legend>Lọc hiển thị</legend>
      <table width="100%">
        <tr>
          <td style="width: 282px">
            <label>Sắp xếp theo</label>
            <asp:DropDownList ID="dropSort" runat="server" CssClass="dropDown" 
              AutoPostBack="True"  Width="150px" 
              onselectedindexchanged="dropSort_SelectedIndexChanged">
              <asp:ListItem Text="Mới nhất" Value="1" Selected="True" />
              <asp:ListItem Text="Cũ nhất" Value="2" />
              </asp:DropDownList>
          </td>
          <td align="left">
            <label>Tình trạng</label>
             <asp:DropDownList ID="dropIsView" runat="server" CssClass="dropDown" 
              Width="100px" AutoPostBack="True" 
              onselectedindexchanged="dropIsView_SelectedIndexChanged" >
               <asp:ListItem Value="0" Text="Tất cả" Selected="True" />
               <asp:ListItem Value="1" Text="Chưa đọc"/>
               <asp:ListItem Value="2" Text="Đã đọc" />
            </asp:DropDownList>
          </td>        
        </tr>
      </table>
      </fieldset>
    </div>    
    <div id="gridview">
    <asp:GridView ID="gridView" runat="server" Width="960px" AutoGenerateColumns="False"
      CellPadding="3" EnableModelValidation="True" GridLines="None" AllowPaging="True"
      BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" 
        CellSpacing="1" PageSize="8" 
      OnRowDataBound="gridView_RowDataBound" 
      OnPageIndexChanging="gridView_PageIndexChanging"      
      OnRowDeleting="gridView_RowDeleting" EmptyDataText="Dữ liệu trống !" 
        onrowcommand="gridView_RowCommand">
      <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
      <HeaderStyle BackColor="#4581BB" Font-Bold="True" ForeColor="#E7E7FF" Height="30px"
        HorizontalAlign="Left" />
      <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" CssClass="page" />
      <RowStyle BackColor="#DEDFDE" ForeColor="Black" CssClass="row-item" />
      <SelectedRowStyle BackColor="#990000" Font-Bold="True" ForeColor="White" Font-Underline="True" />
        <Columns>
        <asp:TemplateField HeaderText="STT">
          <ItemTemplate>
            <%# Container.DataItemIndex+1 %>
          </ItemTemplate>
          <ItemStyle Width="40px" />
        </asp:TemplateField>
          <asp:TemplateField HeaderText="Chọn">
            <ItemTemplate>
              <asp:CheckBox ID="checkBox" runat="server" />
            </ItemTemplate>
            <ItemStyle Width="45px" />
          </asp:TemplateField>
          <asp:BoundField DataField="Id" HeaderText="ID">
          <ItemStyle Width="35px" />
          </asp:BoundField>
          <asp:BoundField DataField="Name" HeaderText="Họ tên">
          <ItemStyle Width="145px" />
          </asp:BoundField>
          <asp:BoundField DataField="Title" HeaderText="Tiêu đề">
          <ItemStyle Width="340px" />
          </asp:BoundField>
          <asp:BoundField DataField="DateSend" HeaderText="Ngày gửi" >
          <ItemStyle Width="70px" />
          </asp:BoundField>
          <asp:BoundField DataField="isRead" HeaderText="Tình trạng" >
          <ItemStyle Width="80px" />
          </asp:BoundField>
          <asp:ButtonField CommandName="Xem" HeaderText="Xem" >
          <ItemStyle ForeColor="#000099" CssClass="btnView" Width="35px" />
          </asp:ButtonField>
           <asp:TemplateField HeaderText="Xóa">
            <ItemTemplate>
              <asp:LinkButton ID="linkDelete" runat="server" CausesValidation="false" Text="" CssClass="btnDelete"
              CommandName="Delete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa ?')">
              </asp:LinkButton>
            </ItemTemplate>
             <ItemStyle Width="30px" />
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
         <asp:UpdateProgress ID="UpdateProgress1" runat="server">
          <ProgressTemplate>
              <img src="../../Images/ajax-loader.gif" alt="Loadding" style="position: absolute; top: 50%; left: 50%; z-index: 1000" />
          </ProgressTemplate>
        </asp:UpdateProgress>
    </div>   
  <div>
      <table style="width: 100%">
        <tr>
          <td align="left" valign="top">
            <asp:LinkButton ID="linkCheckAll" runat="server" Text="" CssClass="button btn-check"
              OnClick="linkCheckAll_Click" />&nbsp; &nbsp; &nbsp;
            <asp:LinkButton ID="linkUnCheckAll" runat="server" Text="" CssClass="button btn-uncheck"
              OnClick="linkUnCheckAll_Click" />
          </td>
          <td align="right">          
            <asp:Button runat="server" ID="btnXoaChon" Text="" CssClass="button btn-delete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa ?')"
              OnClick="btnXoaChon_Click" />
          </td>
        </tr>
      </table>
    </div>
     <div style="margin: 10px 0px">
    <label>
      Số dòng hiển thị trên 1 trang :
    </label>    
    <asp:DropDownList runat="server" ID="dropPageSize" CssClass="dropdown" AutoPostBack="true"
      OnSelectedIndexChanged="dropCountRow_SelectedIndexChanged">
      <asp:ListItem Text=" 10 " Value="10" Selected="True" />
      <asp:ListItem Text=" 20 " Value="20" />
      <asp:ListItem Text=" 30 " Value="30" />
      <asp:ListItem Text=" 50 " Value="50" />
      <asp:ListItem Text=" 100 " Value="100" />
    </asp:DropDownList>
  </div>
    <div style="margin-top: 10px">
    <fieldset class="fieldset">
      <legend>Thông tin người liên hệ</legend>
         <table width="100%" cellspacing="0">
            <tr>
              <td style="width: 100px; height: 30px;">Họ tên :  </td><td><asp:Literal ID="ltName" runat="server" /></td>
            </tr>
            <tr>
              <td style="width: 100px; height: 30px;">Email :</td><td> <asp:Literal ID="ltEmail" runat="server" /> </td>     
            </tr>
            <tr>
              <td style="width: 100px; height: 30px;">Phone : </td><td> <asp:Literal ID="ltPhone" runat="server" /></td>
           </tr>
           <tr>
              <td style="width: 100px; height: 30px;border-bottom:1px solid #017467; padding-bottom: 5px;">Địa chỉ : </td><td style="border-bottom:1px solid #017467"> <asp:Literal ID="ltAddress" runat="server" /></td>
           </tr>
            <tr>
                <td style="width: 100px; height: 30px; padding-top: 5px;">Chi tiết liên hệ</td><td>&nbsp;</td>
            </tr>
              <tr>
                <td style="width: 100px; height: 30px;">Tiêu đề : </td><td> <b><asp:Literal ID="ltTitle" runat="server" /></b></td>
              </tr>
              <tr><td style="width: 100px; height: 30px;">Ngày gửi : </td><td> <i><asp:Literal ID="ltDateSend" runat="server" /></i></td></tr>
              <tr>
                <td valign="top" style="width: 100px; height: 60px;">Nội dung : </td><td valign="top"> <p style="padding-top:5px"><asp:Literal ID="ltContent" runat="server" /></p></td>
              </tr>
      </table>
    </fieldset>
    </div>
  <div style="margin-top: 10px">
    <asp:Literal ID="lbThongBao" runat="server" />
  </div>
   </ContentTemplate> 
    </asp:UpdatePanel>
</asp:Content>

